Title

denstogram(
  data,
  xvar,
  fillvar = NULL,
  facets = NULL,
  grid_wrap = c("grid", "wrap"),
  scales = "fixed",
  facets_ncol = NULL,
  facets_nrow = NULL,
  trans = scales::identity_trans(),
  probs = c(0, 0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99, 1),
  na.rm = TRUE,
  plotly = TRUE
)

Arguments

data

data

xvar

var to plot

fillvar

variable to fill denstogram by

facets

variable to facet the denstogram by

grid_wrap

whether to use a "grid" or "wrap" in facetting

scales

passed to facets

facets_ncol

cols for facets

facets_nrow

rows for facets

trans

transformation to apply from the scales package

probs

quantiles to include in the plot

na.rm

logical; if TRUE, missing values are removed from x. If FALSE any missing values cause an error.

plotly

whether to convert it to an interactive plot using plotly

Value

ggplot object

Examples

denstogram(data = ggplot2::diamonds, xvar = price)
denstogram(data = ggplot2::diamonds, xvar = price, fillvar = color)
denstogram(data = ggplot2::diamonds, xvar = price, fillvar = cut)
denstogram(data = ggplot2::diamonds, xvar = price, facets = cut ~ .)
denstogram(data = ggplot2::diamonds, xvar = price, facets = cut ~ ., grid_wrap = "wrap")
denstogram(data = ggplot2::diamonds, xvar = price, facets = cut ~ color)
denstogram(data = ggplot2::diamonds, xvar = price, fillvar = cut, facets = color ~ .)
denstogram(data = ggplot2::diamonds, xvar = price, fillvar = cut, facets = color ~ ., grid_wrap = "wrap")